package com.mb.demo.vo;/*
 @author mabin
 @DESCRIPTION 
 @create 2023-5-28
*/

import com.mb.demo.group.UpdateGroup;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.util.Date;

@Data
@ToString
@AllArgsConstructor
@NoArgsConstructor
public class UserVo {

    @NotBlank(message = "id必须输入！")
    private String id;
    @NotBlank(message = "姓名不能为空")
    private String name;

    @Min(value = 0)
    @Max(value = 120)
    private String age;
    @Pattern(regexp = "^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\\d{8}$",
            message = "手机号码输入有误！",
            groups = UpdateGroup.class)
    private String phone;

    private Date bir;
}
